﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Runtime.InteropServices;
using System.Xml.Serialization;

namespace WoW.Armory.Data
{
    [ComVisible(true)]
    [XmlRoot("character")]
    public class Character
    {
        #region Fields
        private string _name;
        private string _class;
        private int _classId;
        private string _battleGroup;
        private string _faction;
        private int _factionId;
        private string _gender;
        private int _genderId;
        private string _guildName;
        private string _guildUrl;
        private string _lastModified;
        private int _level;
        private string _race;       
        private int _raceId;
        private string _prefix;
        private string _suffix;
        private string _realm;
        private const string _imageURL = "http://www.wowarmory.com/_images/portraits/wow-";
        #endregion

        #region Properties
        [XmlAttribute("name")]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        [XmlAttribute("class")]
        public string Class
        {
            get { return _class; }
            set { _class = value; }
        }

        [XmlAttribute("classId")]
        public int ClassId
        {
            get { return _classId; }
            set { _classId = value; }
        }

        [XmlAttribute("battleGroup")]
        public string BattleGroup
        {
            get { return _battleGroup; }
            set { _battleGroup = value; }
        }

        [XmlAttribute("faction")]
        public string Faction
        {
            get { return _faction; }
            set { _faction = value; }
        }

        [XmlAttribute("factionId")]
        public int FactionId
        {
            get { return _factionId; }
            set { _factionId = value; }
        }

        [XmlAttribute("gender")]
        public string Gender
        {
            get { return _gender; }
            set { _gender = value; }
        }

        [XmlAttribute("genderId")]
        public int GenderId
        {
            get { return _genderId; }
            set { _genderId = value; }
        }

        [XmlAttribute("guildName")]
        public string GuildName
        {
            get { return _guildName; }
            set { _guildName = value; }
        }

        [XmlAttribute("guildUrl")]
        public string GuildUrl
        {
            get { return _guildUrl; }
            set { _guildUrl = value; }
        }

        [XmlAttribute("lastModified")]
        public string LastModified
        {
            get { return _lastModified; }
            set { _lastModified = value; }
        }

        [XmlAttribute("level")]
        public int Level
        {
            get { return _level; }
            set { _level = value; }
        }

        [XmlAttribute("race")]
        public string Race
        {
            get { return _race; }
            set { _race = value; }
        }

        [XmlAttribute("raceId")]
        public int RaceId
        {
            get { return _raceId; }
            set { _raceId = value; }
        }

        [XmlAttribute("prefix")]
        public string Prefix
        {
            get { return _prefix; }
            set { _prefix = value; }
        }

        [XmlAttribute("suffix")]
        public string Suffix
        {
            get { return _suffix; }
            set { _suffix = value; }
        }

        [XmlAttribute("realm")]
        public string Realm
        {
            get { return _realm; }
            set { _realm = value; }
        }

        [XmlIgnore()]
        public string ImageURL
        {
            get { return _imageURL + _level + "/"+ _genderId + "-" + _raceId + "-" + _classId + ".gif"; }
        } 
        #endregion

        #region Constructors
        public Character()
        {
            
        }
        #endregion

        #region Methods
        #endregion
    }
}
